
% save fig_trunc95.mat
%clear all
%load fig_Reiter.mat
%save fig_Reiter95.mat



rho_u1 = 0.1;
load ../toDynare

name = ['fig_opti',num2str(rho_u1),'.mat'];

clc;
%close all;


load (name,'taut_eps','ut_eps','Bt_eps','Yt_eps','Lt_eps','Ct_eps','kappa_eps','tauk_eps','mut_eps')

coef = ut_eps(1); % normalazing the two graphs to get a 1% change in G for the first graph

Bt1  = Bt_eps/coef;
mut1 = mut_eps/coef;
taut1 = taut_eps/coef;
tauk1 = tauk_eps/coef;
Y1 = Yt_eps/coef;
L1 = Lt_eps/coef;
C1 = Ct_eps/coef;
ut1 = ut_eps/coef;
kappa1 = kappa_eps/coef;
phi = eco.phi;


% I build the  level deviation  of tau of the paper (not the one of the Julia code)
tau1 = -(1 ./taut1+1/(1/phi+1)).^-1;








%%
rho_u2 = 0.99;

name = ['fig_opti',num2str(rho_u2),'.mat'];
load (name,'taut_eps','ut_eps','Bt_eps','Yt_eps','Lt_eps','Ct_eps','kappa_eps','tauk_eps','mut_eps')

%coef = ut_eps(1);

 

coef2 = (1-rho_u2/(solution.R))/(1-rho_u1/(solution.R));
coef = ut_eps(1)/coef2;

Bt2  = Bt_eps/coef;
mut2 = mut_eps/coef;
taut2 = taut_eps/coef;
tauk2 = tauk_eps/coef;
Y2 = Yt_eps/coef;
L2 = Lt_eps/coef;
C2 = Ct_eps/coef;
ut2 = ut_eps/coef;
kappa2 = kappa_eps/coef;

tau2 =  -(1 ./taut2+1/(1/phi+1)).^-1;






%%
LL = length(ut_eps);%length(B_eps);
LL = 60;
X=1:1:LL;

ligne = zeros(LL,1);

LL2 = 200;
X2=1:1:LL2;
ligne2 = zeros(LL2,1);

nx = 2;
ny = 3;

figure;
 
subplot(nx,ny,1);
plot(X,ut1(1:LL),'k-',X,ut2(1:LL),'b--','LineWidth',2);
legend('\rho_u = 0.1','\rho_u = 0.99','Interpreter','latex','Location','northwest')
legend boxoff 
%hold on
%plot(X,ligne,'r--');
title('1. G','Interpreter','latex');
%ylim([-0.4 1.5]);


subplot(nx,ny,2);
plot(X,100*kappa1(1:LL),'k-',X,100*kappa2(1:LL),'b--','LineWidth',2);% in percent
title('2. $\kappa$','Interpreter','latex');
hold on
plot(X,ligne,'r--');


%ylim([-0.8 0.1]);


subplot(nx,ny,3);
plot(X,100*tau1(1:LL),'k-',X,100*tau2(1:LL),'b--','LineWidth',2); % in percent
hold on
plot(X,ligne,'r--');
title('3. $\tau$','Interpreter','latex');

subplot(nx,ny,4);
plot(X,100*tauk1(1:LL),'k-',X,100*tauk2(1:LL),'b--','LineWidth',2);
hold on
plot(X,ligne,'r--');
title('4. $\tau^k$','Interpreter','latex');
%ylim([-0.02 0.]);


subplot(nx,ny,5);
plot(X2,Bt1(1:LL2),'k-',X2,Bt2(1:LL2),'b--','LineWidth',2);
hold on
plot(X2,ligne2,'r--');
title('5. $B$','Interpreter','latex');
%ylim([-0.02 0.]);

subplot(nx,ny,6);
plot(X2,mut1(1:LL2),'k-',X2,mut2(1:LL2),'b--','LineWidth',2);
hold on
plot(X2,ligne2,'r--');
title('6. $\mu$','Interpreter','latex');
%ylim([-0.02 0.]);



